package com.example.monitorapp.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.navigation.Navigation
import com.example.baselib.activity.BaseViewModelActivity
import com.example.monitorapp.R
import com.example.monitorapp.viewmodel.UserInfoViewModel
import kotlinx.android.synthetic.main.activity_user_info.*

class UserInfoActivity : BaseViewModelActivity<UserInfoViewModel>() {
    override fun providerVMClass(): Class<UserInfoViewModel>? {
       return UserInfoViewModel::class.java
    }


    override fun layoutResId(): Int {
       return R.layout.activity_user_info
    }

    override fun initView() {
        setStatusDark(true)
        setToolbarBlackRes(R.mipmap.back_b)
        setToolbarMenuRes(R.mipmap.menu_b)
        setToolbarMenu(false,-1)
        Navigation.findNavController(this, R.id.user_nav_fragment).addOnDestinationChangedListener { controller, destination, arguments ->
            when(destination.id){
                R.id.userInfoFragment -> setToolbarMsg("个人信息")
                R.id.changePwdFragment -> setToolbarMsg("修改密码")
                R.id.bindTelFragment -> setToolbarMsg("绑定手机")
            }
        }


    }

    override fun initData() {
    }

    override fun backOnClick() {
        onBackPressed()
    }

}
